#ifndef __VISUALISER_STATE_H__
#define __VISUALISER_STATE_H__

////////////////////////////////////////////////////////////////////////////////
// Includes
////////////////////////////////////////////////////////////////////////////////

#include <vector>
#include "ExplorerEngine.hpp"
#include "Point3D.hpp"
#include "Vector3D.hpp"
#include "Triple.hpp"
#include "Quadruple.hpp"

////////////////////////////////////////////////////////////////////////////////
// Namespaces
////////////////////////////////////////////////////////////////////////////////

namespace SC {

////////////////////////////////////////////////////////////////////////////////
// Implementation
////////////////////////////////////////////////////////////////////////////////

/// Explorer data
struct ExplorerData {

	/// Explorer bodies
	std::vector< LEBody<LEB_P,LEB_D> > bodies;

	/// Graph nodes explorer bodies
	std::vector< std::vector<unsigned int> > nodes_bodies;

};

/// Structure node data
struct StructureNodeData {

	/// Location
	Types::Point3D<float> struct_location;

	/// Velocity
	Types::Vector3D<float> struct_velocity;

	/// Mass
	float struct_mass;

	/// Usage
	float usage;

};

/// Structure data
struct StructureData {

	/// Nodes data
	std::vector<StructureNodeData> nodes_data;

	/// Interaction links
	std::vector< Types::Triple<unsigned int, unsigned int, float> > interaction_links;

	/// Number of computations
	unsigned int nb_computations;

	/// Surfaces
	std::vector<
		Types::Quadruple<
			std::pair< const Types::Point3D<float> *, const int * >,
			std::pair< const Types::Point3D<float> *, const int * >,
			std::pair< const Types::Point3D<float> *, const int * >,
			unsigned long
		>
	> surfaces;

};

/// Visualiser state. Used to restore the visualiser in a previous state.
struct VisualiserState {

	/// Explorer data
	ExplorerData explorer_data;

	/// Structure data
	StructureData structure_data;

	/// Stored changes
	std::vector< std::vector< std::pair<unsigned int, int> > > nodes_changes;

};

////////////////////////////////////////////////////////////////////////////////
// Closing Namespaces
////////////////////////////////////////////////////////////////////////////////

}

////////////////////////////////////////////////////////////////////////////////

#endif
